import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CardCollageVO, CardCollageQuery } from '@/api/system/cardCollage/types';

/**
 * 查询拼团直播列表
 * @param query
 * @returns {*}
 */

export const queryOpenCardCollageList = (query?: CardCollageQuery): AxiosPromise<CardCollageVO[]> => {
  return request({
    url: '/system/liveReport/queryOpenCardCollageList',
    method: 'get',
    params: query
  });
};

/**
 * 查询拼团直播
 * @param query
 * @returns {*}
 */

export const getCollageVideoUrl = (query: any) => {
  return request({
    url: '/system/liveReport/getCollageVideoUrl/' + query,
    method: 'get'
  });
};

/**
 * 直播重置
 * @param query
 * @returns {*}
 */

export const resetLive = (id: any) => {
  return request({
    url: '/system/liveReport/resetLive/' + id,
    method: 'post'
  });
};

/**
 * 直播结束
 * @param query
 * @returns {*}
 */
export const endLive = (id: any) => {
  return request({
    url: '/system/liveReport/endLive/' + id,
    method: 'post'
  });
};

/**
 * 查看存在的拆卡信息
 * @param query
 * @returns {*}
 */
export const viewOpenReportInfo = (query: any) => {
  return request({
    url: '/system/liveReport/viewOpenReportInfo',
    method: 'get',
    params: query
  });
};

/**
 * 撤回拆卡报告
 * @param id
 * @returns {*}
 */
export const deleteOpenReport = (id: any) => {
  return request({
    url: '/system/liveReport/deleteOpenReport/' + id,
    method: 'post'
  });
};

/**
 * 查看拼团的卡密信息
 * @param id
 * @returns {*}
 */
export const getCarmiByCollageIdInfo = (query: any) => {
  return request({
    url: '/system/liveReport/getCarmiByCollageIdInfo',
    method: 'get',
    params: query
  });
};

/**
 * 追加拆卡报告
 * @param id
 * @returns {*}
 */
export const appendOpenReport = (data: any) => {
  return request({
    url: '/system/liveReport/appendOpenReport',
    method: 'post',
    data: data
  });
};

/**
 * 上传图片
 * @param id
 * @returns {*}
 */
export const addReportImagePath = (data: any) => {
  return request({
    url: '/system/liveReport/addReportImagePath',
    method: 'post',
    data: data
  });
};

/**
 * 删除图片/好卡设置
 * @param id
 * @returns {*}
 */
export const deleteImagePath = (data: any) => {
  return request({
    url: '/system/liveReport/deleteImagePath',
    method: 'post',
    params: data
  });
};

/**
 * 生成拆卡报告
 * @param id
 * @returns {*}
 */
export const openReportSave = (id: any) => {
  return request({
    url: '/system/liveReport/openReportSave/' + id,
    method: 'post'
  });
};
